package com.dxy.yesas2020goals.study.partone.disignprinciple.liskovsutiution.isperror;

/**
 * @author victorydeng
 * @Classname IspTest
 * @Description TODO
 * @Date 2020/2/24 22:43
 * @Created by victorydeng
 */
public class IspTest {

  public static void resize(Rectangle rectangle) {
    while (rectangle.getWidth() >= rectangle.getHeight()) {
      rectangle.setHeight(rectangle.getHeight() + 1);
      System.out.println("长方形的Width:" + rectangle.getWidth() + "长方形的,Height:" + rectangle.getHeight());
    }
    System.out.println("调用Resize End,Width:" + rectangle.getWidth() + ",Height:" + rectangle.getHeight());
  }

//    public static void main(String[] args) {
//        Rectangle rectangle = new Rectangle();
//        rectangle.setWidth(20);
//        rectangle.setHeight(10);
//        resize(rectangle);
//    }


  //使用正方形去替换长方形调用resize方法返回结果不一样
  public static void main(String[] args) {
    Square1 square = new Square1();
    square.setLength(10);
    resize(square);
  }

}
